package org.mebusw.dbc;

import java.sql.Connection;
import java.sql.DriverManager;

public class DataBaseConnection {
	public static final String DBDRIVER = "com.mysql.jdbc.Driver";
	private Connection conn = null;

	public static final String DBURL = "jdbc:mysql://localhost/davinci?useUnicode=true&characterEncoding=latin1";
	public static final String DBUSER = "";
	public static final String DBPASSWORD = "";

	public DataBaseConnection() {
		try {
			Class.forName(DBDRIVER);
			conn = DriverManager.getConnection(DBConnInfo.DBURL,
					DBConnInfo.DBUSER, DBConnInfo.DBPASSWORD);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public Connection getConnection() {
		return conn;
	}

	public void close() {
		if (this.conn != null) {
			try {
				this.conn.close();
			} catch (Exception e) {
			}
		}
	}

}
